package org.example.controller;

import cn.dev33.satoken.stp.StpUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import springfox.documentation.annotations.ApiIgnore;

@Controller
public class IndexController {

    @ApiIgnore
    @GetMapping(value = {"/"})
    public String index() {
        return "redirect:/mainPage";
    }

    @ApiIgnore
    @GetMapping(value = {"/mainPage"})
    public String login() {
        return "index";
    }


    @ApiIgnore
    @GetMapping(value = {"/api/logout"})
    public String logout() {
        StpUtil.logout();
        return "redirect:/mainPage";
    }

}
